<?php

namespace App\Http\Service\frontend;

class CourseService
{

    protected $timeScrolling = ["日", "一", "二", "三", "四", "五", "六"];

    public function index() {
        $data = [];
        for ($i = 0; $i < 7; $i++) {
            $cycle = "星期" . $this->timeScrolling[date("w", strtotime("+" . $i . " day"))];
            if (date("m-d", strtotime("+" . $i . " day")) == date("m-d", time())) {
                $cycle = "今天";
            }
            $data [] = [
                'time' => date("Y-m-d h:i:s", strtotime("+" . $i . " day")),
                'timeAxis' => date("m-d", strtotime("+" . $i . " day")),
                'cycle' => $cycle,
                'strtotime' => strtotime(date("Y-m-d 00:00:00", strtotime("+" . $i . " day"))),
            ];
        }
        return $data;
    }

}
